export const cascaderProps = {
  children: "sub",
  label: "name",
  value: "id",
  checkStrictly: true,
};

export const defaultTime = [
  new Date(2000, 1, 1, 0, 0, 0),
  new Date(2000, 2, 1, 23, 59, 59),
];

//递归调用
export const treeToArray = (tree) => {
  let arr = [];
  const expanded = (datas) => {
    if (datas && datas.length > 0) {
      datas.forEach((e) => {
        if (!e.pid) {
          e.pid = null;
        }
        arr.push(e);
        expanded(e.sub);
      });
    }
  };
  expanded(tree);
  return arr;
};
